\documentclass{article}

\usepackage{pgfplots}

\pgfplotsset{compat=1.13}

% \usetikzlibrary{}
% \usepgfplotslibrary{}

\begin{document}

\begin{tikzpicture}
%\tracingcommands=2\tracingmacros=2
	\begin{axis}[
		colorbar,
		colormap access=piecewise constant,
		/pgfplots/colormap access/extra interval width/.try=h,
	]
	\addplot3[surf,shader=interp,samples=25] {x*y};	
	\end{axis}
\end{tikzpicture}
\end{document}

